﻿using System;
using System.Reflection;

namespace Fabrication.ValueProviders
{
    internal sealed class ArrayProvider : IValueProvider
    {
        private Type elementType;

        public void Initialize(PropertyInfo property)
        {
            elementType = property.PropertyType.GetElementType();
        }

        object IValueProvider.GetValue(object item)
        {
            return Array.CreateInstance(elementType, 0);
        }
    }
}